import os
import shutil

for f in os.listdir():
    if os.path.basename(f)[:2]=='R.' and os.path.basename(f)[-3:]=='.md':
        continue
    if os.path.basename(f)[-3:]=='.md':
        os.system("pandoc -s --toc --toc-depth=5 %s -o R.%s" %(f,f))

os.system('git pull')
os.system('git add .')
os.system('git commit -m "AutoCommit"')
os.system('git push')
